package com.example.a2205_fx.util;

import com.example.a2205_fx.entity.GiftEntity;
import com.example.a2205_fx.entity.PinglunEntity;
import com.example.a2205_fx.entity.ResultEntity;
import com.example.a2205_fx.entity.UserEntity;
import com.example.a2205_fx.entity.VideoEntity;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiServer {
    @POST(Cons.LOGIN_URL)
    Observable<UserEntity> login(@Body RequestBody body);
    @POST(Cons.REGISTER_URL)
    Observable<UserEntity> register(@Body RequestBody body);
    @GET(Cons.VIDEO_URL)
    Observable<VideoEntity> video(@Query("currentPage") int page,@Query("pageSize")int size);
    @POST(Cons.LOVE_URL)
    Observable<ResultEntity> love(@Query("videoId") int videoId);
    @POST(Cons.NOLOVE_URL)
    Observable<ResultEntity> nolove(@Query("videoId")int videoId);
    @GET(Cons.GETCOMMENT_URL)
    Observable<PinglunEntity> getComment(@Query("videoId") int videoId);
    @POST(Cons.COMMENT_URL)
    Observable<PinglunEntity> comment(@Body RequestBody body);
    @GET(Cons.GIFT_URL)
    Observable<GiftEntity> gift();
}
